<!-- http://www.imooc.com/wiki/uniapp/databinding.html -->
<template>
	
	<view class="uni_root">
	    <tab 
	        v-model="activeKey" 
	        :navData="scrollData"
	        @change="tabChange"
	        @tabClick="tabClick"
			:tabFix="{position:'fixed'}"
	    >
	        <view :slot="item.slot" v-for="(item,key) in scrollData" :key="key">
	            <scroll-view scroll-y height="400rpx">
					<view v-if="scrollIndex == 1">
						<forestRegistration :user_info="forest_user_info"></forestRegistration>
					</view>
					<view v-else>
						第{{key+1}}页 ------------
					</view>
				</scroll-view>
			</view>
		</tab>
	</view>
</template>

<script>
	import tab from '@/components/Mark-Tab/Tab.vue'
	import forestRegistration from "./forestRegistration.vue"
	
	export default {
		//注册组件
		components: {
		  tab,
		  forestRegistration,
	    },
		data () {
			return {
				activeKey: 0,
				scrollIndex: 1,
				scrollData: [
					{
						label:'预报名',
						slot:'slot-1'
					},
					{
						label:'正式报名',
						slot:'slot-2'
					}
				],
				forest_user_info: {
					picture_sign: null,
				},
				
				// 用于提交的user信息
				user_info: {
					id: null,
					name: '',
					phone_number: null,
					selected_major: '',
					sex: '',
					province: '',
					city: '',
					area: '',
					current_school: '',
					current_class: '',
					address_detail: '',
					address_selected: '',
					
					picture_id_card_positive: null,
					picture_id_card_negative: null,
					picture_sign: null,
				},
				
			}
		},
		methods: {
			tabChange(e){
				console.log(e);
				this.scrollIndex = e.index + 1;
				console.log('scrollIndex', this.scrollIndex);
			},
			tabClick(e){
				console.log(e);
			}
		}
	}
</script>
	
<style lang="scss" scoped>
</style>
